package com.ParkingManager.app.web;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ParkingManager.app.service.AlipayService;
/**
 * 
 * @author 庞晓军
 * @description 支付控制类
 */
@RestController
@RequestMapping("/payment")
public class PaymentController {
	@Autowired
    AlipayService alipayService;

	/**
	 * 阿里巴巴支付服务
	 * @param response
	 * @param request
	 * @param price
	 * @param id
	 */
    @RequestMapping("/pay")
    public void payMent(HttpServletResponse response, HttpServletRequest request,double price,int id) {
        try {
            alipayService.aliPay(response,request,price,id);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
